import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class DataService {
  private data$ = new BehaviorSubject(null);
  constructor() { }
  updateData(data) {
    this.data$.next(data);
  }
  getData(): Observable<any> {
    return this.data$.asObservable();
  }
}
